<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./index.js"></script>
</head>
<body>
<button id="debounce">防抖</button>
<button id="throttle">节流</button>
<script>
    const clickMe = ()=> {
        console.log('我被点击了')
    }
    const clickThrottle = () => {
        console.log('我也被点了')
    }
    document.querySelector('#debounce').addEventListener('click',debounce(clickMe,500));
    document.querySelector('#throttle').addEventListener('click',throttle(clickThrottle,500));
</script>
</body>
</html>
